home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 15 code / Floating Windows / Infinity Windoid WDEF 3.0 / Source Code / WindoidDraw.h < prev    next >
Encoding:
Text File  |  1995-02-20  |  5.3 KB  |  197 lines  |  [TEXT/MMCC]

  1. // *****************************************************************************
  2. //
  3. //    WindoidDraw.h
  4. //
  5. // —————————————————————————————————————————————————————————————————————————————
  6. //    Copyright © 1991-95 Infinity Systems.  All rights reserved.
  7. // —————————————————————————————————————————————————————————————————————————————
  8. #ifndef Infinity_WINDOIDDRAW
  9. #define Infinity_WINDOIDDRAW
  10.  
  11. #include "WindoidDefines.h"
  12.  
  13. #include <Fonts.h>
  14. #include <Types.h>
  15. #include <Windows.h>
  16.  
  17.  
  18. // *****************************************************************************
  19. //
  20. //    Constants
  21. //
  22. // *****************************************************************************
  23.  
  24. // —————————————————————————————————————————————————————————————————————————————
  25. //
  26. //    Titlebar and gadget sizes and offsets
  27. //
  28. // —————————————————————————————————————————————————————————————————————————————
  29. enum {
  30.     kTingeInset        =  1,        // When insetting to adjust for window sides.
  31.  
  32.   #if qApple75Design
  33.     kTitleHeight    = 15,        // Height of the windoid’s titlebar.
  34.     kTitleVDelta    =  3,        // Height of baseline from bottom of titlebar.
  35.     kGadgetMargin    =  4,        // Space between edge and gadget.
  36.     kGadgetHitFudge    =  0        // Slop area around gadgets for hit testing.
  37.  
  38.   #else
  39.     kTitleHeight    = 13,
  40.     kTitleVDelta    =  2,
  41.     kGadgetMargin    =  8,
  42.     kGadgetHitFudge    =  1
  43.     
  44.   #endif
  45. };
  46.  
  47. #define kGadgetInset (2 + kTingeInset)       // Inset from top/bottom of titlebar.
  48. #define kGadgetSize  (kTitleHeight - (2 * kGadgetInset))
  49.  
  50.  
  51. // —————————————————————————————————————————————————————————————————————————————
  52. //
  53. //    Scroll Bar width
  54. //
  55. // —————————————————————————————————————————————————————————————————————————————
  56. enum {
  57.   #if qApple75Design
  58.     kScrollBarPixels = 15
  59.  
  60.   #elif qSmallGrow
  61.     kScrollBarPixels = 13
  62.  
  63.   #else
  64.     kScrollBarPixels = 16
  65.   #endif
  66. };
  67.  
  68.  
  69. // —————————————————————————————————————————————————————————————————————————————
  70. //
  71. //    Font information for titlebar title
  72. //
  73. // —————————————————————————————————————————————————————————————————————————————
  74. enum {
  75.     kTitleFont        = applFont,
  76.     kTitleSize        = 9,
  77.  
  78.   #if qApple75Design
  79.     kTitleStyle        = 0,    // Plain.
  80.     kTitleMargin    = 4        // Space between pattern and edges of text.    
  81.  
  82.   #else
  83.     kTitleStyle        = bold,
  84.     kTitleMargin    = 5        // Space between pattern and edges of text.
  85.   #endif
  86. };
  87.  
  88.  
  89. // —————————————————————————————————————————————————————————————————————————————
  90. //
  91. //    Color table tinge percentage constants    
  92. //
  93. // —————————————————————————————————————————————————————————————————————————————
  94. enum {
  95.     wTitleBarLightPct        = 0x1,
  96.     wTitleBarTingeDarkPct    = 0x4,
  97.  
  98.   #if qApple75Design
  99.     wCloseBoxColor            = 0x4,    // the area is larger, so the gray is lighter
  100.     wTitleBarDarkPct        = 0xC,    // dots are more dispersed, so darker
  101.     wXedBoxPct                = 0x0,
  102.  
  103.   #else
  104.     wCloseBoxColor            = 0x5,
  105.     wTitleBarDarkPct        = 0x8,
  106.     wXedBoxPct                = 0x8,
  107.   #endif
  108.  
  109.     wGrowBoxBackground        = 0x1,
  110.     wGrowBoxColorLt            = 0x4,
  111.     wGrowBoxColorDk            = 0x5,
  112.  
  113.     wInactiveFramePct        = 0xA,
  114.     wInactiveTextPct        = 0x7
  115. };
  116.  
  117.  
  118. // —————————————————————————————————————————————————————————————————————————————
  119. //
  120. //    Color table constants    
  121. //
  122. // —————————————————————————————————————————————————————————————————————————————
  123. //        These are the constants defined in the Apple technical note regarding
  124. //        Color, Windows, and System 7. Last I checked, they weren't in an Apple
  125. //        header file. (But the ones < 5 are, from the previous, pre-System 7
  126. //        coloring scheme.)
  127. // —————————————————————————————————————————————————————————————————————————————
  128. enum {
  129.     wHiliteColorLight = 5, 
  130.     wHiliteColorDark,
  131.     wTitleBarLight,
  132.     wTitleBarDark,
  133.     wDialogLight,
  134.     wDialogDark,
  135.     wTingeLight,
  136.     wTingeDark
  137. };
  138.  
  139.  
  140. // *****************************************************************************
  141. //
  142. //    Prototypes
  143. //
  144. // *****************************************************************************
  145.  
  146. // —————————————————————————————————————————————————————————————————————————————
  147. //
  148. //    Part rectangles
  149. //
  150. // —————————————————————————————————————————————————————————————————————————————
  151. void GetTitleBarRect(WindowPeek window, Rect *titleBar);
  152.  
  153. void GetCloseBox(WindowPeek window, Rect *theRect);
  154.  
  155. void GetZoomBox(WindowPeek window, Rect *theRect);
  156.  
  157. void GetGrowBox(WindowPeek window, Rect *theRect);
  158.  
  159.  
  160. // —————————————————————————————————————————————————————————————————————————————
  161. //
  162. //    Coloring
  163. //
  164. // —————————————————————————————————————————————————————————————————————————————
  165. void SetWFrameColor(WindowPeek window, Boolean isColor);
  166.  
  167. void SetWTitleColor(WindowPeek window, Boolean isColor);
  168.  
  169. void SetWTitleBarColors(WindowPeek window, Boolean isColor);
  170.  
  171. void SetGadgetFrameEraseColors(WindowPeek window, Boolean isColor);
  172.  
  173.  
  174. // —————————————————————————————————————————————————————————————————————————————
  175. //
  176. //    Part drawing
  177. //
  178. // —————————————————————————————————————————————————————————————————————————————
  179. void DrawCloseBox(WindowPeek window, Boolean isColor, const Rect *theRect);
  180.  
  181. void DrawZoomBox(WindowPeek window, Boolean isColor, const Rect *theRect);
  182.  
  183. void DrawXedBox(WindowPeek window, Boolean isColor, const Rect *theRect);
  184.  
  185. void DrawGrowBox(WindowPeek window, Boolean isColor);
  186.  
  187. void ToggleCloseBox(WindowPeek window, Boolean isColor);
  188.  
  189. void ToggleZoomBox(WindowPeek window, Boolean isColor);
  190.  
  191. void DrawTitleBar(WindowPeek window, Boolean isColor);
  192.  
  193. void DrawWindowFrame(WindowPeek window, Boolean isColor);
  194.  
  195.  
  196. // —————————————————————————————————————————————————————————————————————————————
  197. #endif